{% if site.authors[include.author].name %}
  {% assign author=site.authors[include.author]  %}
{% else %}
  {% assign author=site.authors["anonymous"] %}
{% endif %}

{% assign date=include.date %}

<div class="byline">
  {% if include.link == true %}<a href="{{ site.baseurl }}/authors/#{{ include.author }}">{% endif %}
    <div class="avatar">
        <img
          {% if author.avatar %}
            srcset="{{ site.baseurl }}/avatar-2x/{{ author.avatar }}.png 2x"
            src="{{ site.baseurl }}/avatar/{{ author.avatar }}.png"
            alt="{{ author.name }} 的头像"
          {% else %}
            srcset="{{ site.baseurl }}/avatar-2x/{{ author.avatar }}.png 2x"
            src="{{ site.baseurl }}/avatar/{{ site.avatar }}.png"
            alt="头像"
          {% endif %}
        />
    </div>
  {% if include.link == true %}</a>{% endif %}  
  <div class="author">
    {% if include.link == true %}<a href="{{ site.baseurl }}/authors/#{{ include.author }}">{% endif %}
    <span class="name">{{ author.name }}</span>
    {% if include.link == true %}</a>{% endif %}
    {% if author.description and page.layout == 'post' %}
      <span class="description">{{ author.description }}</span>
    {% endif %}
  </div>
  <time class="post-date" datetime="{{ date | date:"%Y-%m-%d" }}">{{ date | date: "%Y-%m-%d" }}</time>
  {% if include.content %}
    {% include read-time.html content=include.content %}
  {% endif %}
</div>

